#include "stdafx.h"
#include "GPXRoot.h"

using namespace std;


void GPXRoot::printInfo()
{
	
	if(tracks.size() > 0) {
	cout << "| Details" << endl;
	cout << "|- Creator: " << this->getCreator() << endl;
	cout << "|- Version: " << this->getVersion() << endl;
	cout << "|- Anzahl der Tracks: "<<  this->tracks.size()  << endl;
	cout << "|" <<endl;
	 int tracks = this->tracks.size();

	 for (int i = 0; i < tracks; i++)
	 {
		TRKType temp =  this->tracks.at(i);
		temp.getMaxAndMinElevation();
	temp.printInfo();
	
	 }
	}
	if(waypoints.size() > 0) {
		cout << "Waypoints" << endl;
		
		for(int i = 0; i < waypoints.size(); i++)
			waypoints.at(i).printInfo();

	}
}

GPXRoot::GPXRoot() {

	waypoints = vector<WPTType>();
	tracks = vector<TRKType>();
}

void GPXRoot::setVersion( std::string val )
{
	version = val;
}

std::string GPXRoot::getVersion() const
{
	return version;
}

void GPXRoot::setCreator( std::string val )
{
	creator = val;
}

std::string GPXRoot::getCreator() const
{
	return creator;
}

void GPXRoot::setMaxlat( double val )
{
	maxlat = val;
}

double GPXRoot::getMaxlat() const
{
	return maxlat;
}

void GPXRoot::setMaxlon( double val )
{
	maxlon = val;
}

double GPXRoot::getMaxlon() const
{
	return maxlon;
}

void GPXRoot::setMinlat( double val )
{
	minlat = val;
}

double GPXRoot::getMinlat() const
{
	return minlat;
}

void GPXRoot::setMinlon( double val )
{
	minlon = val;
}

double GPXRoot::getMinlon() const
{
	return minlon;
}

void GPXRoot::setLink( std::string val )
{
	link = val;
}

std::string GPXRoot::getLink() const
{
	return link;
}

void GPXRoot::setLinktext( std::string val )
{
	linktext = val;
}

std::string GPXRoot::getLinktext() const
{
	return linktext;
}

void GPXRoot::setTime( std::string val )
{
	time = val;
}

std::string GPXRoot::getTime() const
{
	return time;
}



